package com.example.demo.service.impl;

import com.example.demo.dao.IBookDao;
import com.example.demo.entity.Book;
import com.example.demo.service.IBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements IBookService {

    @Autowired
    private IBookDao bookDao;

    @Override
    public void insert(Book book) {
        bookDao.insert(book);
    }

    @Override
    public void update(Book book) {
        bookDao.update(book);
    }

    @Override
    public void delete(int id) {
        bookDao.delete(id);
    }

    @Override
    public Book selectById(int id) {
        return bookDao.selectById(id);
    }

    @Override
    public List selectAll() {
        return bookDao.selectAll();
    }

    @Override
    public List<Book> selectByKey(String tel) {
        return bookDao.selectByKey(tel);
    }

    @Override
    public List<Book> selectByUserName(String username) {
        return bookDao.selectByUserName(username);
    }
}
